/* 获取 json 格式的天气
请求地址：http://wthrcdn.etouch.cn/weather_mini
请求方法：get
请求参数：city */
var app = new Vue({
    el: "#app",
    data: {
        city: '请输入要查询的城市名称.',
        cityWeather: []
    },
    methods: {
        weather: function () {
            var thad = this;
            axios.get("http://wthrcdn.etouch.cn/weather_mini?city="
                + this.city)
                .then(function (response) {
                    // console.log(response.data.data.forecast);
                    thad.cityWeather = response.data.data.forecast;
                })
                .catch(function (err) {
                    alert('查询不到输入的名称。');
                })
        },
        cityList: function (city) {
            this.city = city;
            this.weather();
        },
        clear: function () {
            this.city = '';
        },
        mouseAdd: function ($event) {
            // console.log('鼠标经过');
            $event.currentTarget.className = "nav_bd mouse";

        },
        
        mouse: function ($event) {
            // console.log('鼠标移出');
            $event.currentTarget.className = "nav_bd";
        }
    }

})